/**
 * Common constants for all features.
 */
export class CommonConstants {
  /**
   * Search weight.
   */
  static readonly SEARCH_WEIGHT: number = 10;

  /**
   * The placeholder of search component.Currently, component interfaces do not support the Resource type.
   * Therefore, you need to define constants. The default prompt in the search box does not support
   * internationalization.
   */
  static readonly SEARCH_PLACEHOLDER: string = 'Search...';

  /**
   * Search font family.
   */
  static readonly SEARCH_FONT_FAMILY: string = 'serif';

  /**
   * The font weight of text in the index list.
   */
  static readonly INDEX_LIST_FONT_WEIGHT: number = 400;

  /**
   * Size of index list and detail list.
   */
  static readonly LIST_SIZE: number = 6;

  /**
   * The percentage of the index list width.
   */
  static readonly INDEX_LIST_WIDTH_PERCENT: string = '30%';

  /**
   * The percentage of the index list height.
   */
  static readonly INDEX_LIST_HEIGHT_PERCENT: string = '100%';

  /**
   * The font weight of text in the detail list.
   */
  static readonly DETAIL_LIST_FONT_WEIGHT: number = 500;

  /**
   * The percentage of the detail list width.
   */
  static readonly DETAIL_LIST_WIDTH_PERCENT: string = '70%';

  /**
   * The percentage of the detail list height.
   */
  static readonly DETAIL_LIST_HEIGHT_PERCENT: string = '100%';

  /**
   * The font weight of text in the tab.
   */
  static readonly TAB_ITEM_FONT_WEIGHT: number = 500;

  /**
   * Size of tab bar.
   */
  static readonly TAB_BAR_SIZE: number = 5;

  /**
   * Tab layout weight.
   */
  static readonly TAB_LAYOUT_WEIGHT: number = 1;

  /**
   * The percentage of the tab bar width.
   */
  static readonly TAB_BAR_WIDTH_PERCENT: string = '100%';

  /**
   * The font weight of navigation title.
   */
  static readonly TITLE_FONT_WEIGHT: number = 500;

  /**
   * The font weight of navigation subtitle.
   */
  static readonly SUBTITLE_FONT_WEIGHT: number = 400;

  /**
   * Size of grid item.
   */
  static readonly GRID_ITEM_SIZE: number = 6;

  /**
   * Category layout weight.
   */
  static readonly CATEGORY_LAYOUT_WEIGHT: number = 1;

  /**
   * Text length.
   */
  static readonly TEXT_LENGTH: number = 100;

  /**
   * Grid columns template.
   */
  static readonly COLUMNS_TEMPLATE: string = '1fr 1fr';

  /**
   * Grid rows template.
   */
  static readonly ROWS_TEMPLATE: string = '1fr 1fr 1fr';

  /**
   * The percentage of the text width.
   */
  static readonly TEXT_WIDTH_PERCENT: string = '100%';

  /**
   * The percentage of the navigation width.
   */
  static readonly NAVIGATION_WIDTH_PERCENT: string = '100%';


  static readonly CAMERA_PREVIEW_WIDTH_PERCENT: string = '40%';

  static readonly CAMERA_PREVIEW_HEIGHT_PERCENT: string = '40%';

  /**
   * 页面宽度
   */
  static readonly PAGE_WIDTH_PERCENT: string = '100%';

  /**
   * 页面高度
   */
  static readonly PAGE_HEIGHT_PERCENT: string = '100%';

  //===================测试工具==========================//
  //重启压力测试开关状态
  static readonly KEY_TEST_TOOLS_REBOOT_PRESSURE_TOGGLE: string = "reboot_pressure";
  //重启压力测试-测试成功次数
  static readonly KEY_TEST_TOOLS_REBOOT_PRESSURE_SUCCESS_TIMES: string = "reboot_pressure_success_times";
  //重启压力测试，开机后再次重启停留时间
  static readonly REBOOT_PRESSURE_STOPOVER_TIME_MILLIS: number = 60;

  //掉电测试开关状态
  static readonly KEY_TEST_TOOLS_POWER_DOWN_TOGGLE: string = "power_down";
  static readonly KEY_TEST_TOOLS_POWER_DOWN_SUCCESS_TIMES: string = "power_down_success_times";

  //----camera test------
  // change directory, change default directory /Picture/ to /Picture/OsTools/CameraTest/
  static readonly DIRECTORY_CAMERA_TEST_PHOTO_SAVE: string = 'OsTools/CameraTest/'
  // This path can theoretically be obtained using api, but what is currently obtained is incorrect
  // environment.getUserDataDir() is /storage/media/0/local/files/
  static readonly DIRECTORY_USER_DATA_DIR: string = '/storage/media/100/local/files/'

  static readonly KEY_SETTINGS_SYS_AUTOPOWER = 'settings.sys.autopower';
  //设置的定时开关机时间
  static readonly KEY_PERSIST_SHIMETA_AUTOPOWER_ENABLE = 'persist.shimeta.autopower_enable';
  static readonly KEY_PERSIST_SHIMETA_AUTOPOWER_OFF_TIME_HOUR = 'persist.shimeta.autopower_off_time_hour';
  static readonly KEY_PERSIST_SHIMETA_AUTOPOWER_OFF_TIME_MINUTE = 'persist.shimeta.autopower_off_time_minute';
  static readonly KEY_PERSIST_SHIMETA_AUTOPOWER_ON_TIME_HOUR = 'persist.shimeta.autopower_on_time_hour';
  static readonly KEY_PERSIST_SHIMETA_AUTOPOWER_ON_TIME_MINUTE = 'persist.shimeta.autopower_on_time_minute';
  static readonly KEY_PERSIST_SHIMETA_AUTOPOWER_WEEK = 'persist.shimeta.autopower_week';
  //开机守护
  static readonly KEY_SETTINGS_SYS_PROTECT_APP_BUNDLENAME = 'settings.sys.protect_app_bundlename';
  static readonly KEY_SETTINGS_SYS_PROTECT_APP_TTME = 'settings.sys.shimeta.protect_app_time';


  //开机状态
  static readonly KEY_SETTINGS_SYS_POWER_ENABLE = 'settings.sys.power_enable';
  //关机时间
  static readonly KEY_SETTINGS_SYS_POWER_OFF_TIME = 'settings.sys.power_off_time';
  //开机时间
  static readonly KEY_SETTINGS_SYS_POWER_ON_TIME = 'settings.sys.power_on_time';


  static readonly COMMON_EVENT_POWER_TIME = 'common_event.power_time';

  //导航栏
  static readonly NAVIGATION_BAR_SATTUS_KEY = 'settings.display.navigationbar_status';
  //状态栏
  static readonly STATUS_BAR_SATTUS_KEY = 'settings.display.statusbar_status';
 //Log开关状态
  static readonly LOG_STATUS = 'persist.shimeta.sys.persist_log.status';
  //以太网静动态状态
  static readonly  ETHERNET_STATE = 'persist.shimeta.sys.persist_ethernet.status';
  //升级状态 0：正常开机 1 ：升级成功/失败后开机
  static readonly  UPDATE_RESULT_STATUS = 'persist.shimeta.update_result_status';
  //hdc开关状态
  static readonly  HDC_STATUS = 'persist.shimeta.hdc.status';

  static readonly ETHE_STATUS_CODE = 'ethernet.status.code';
  //软件版本号
  static readonly VERSION = 'V1.0.0';


  /**
   * 获取拼接后的uri，适配settingsdata去常驻
   *
   * @param key settings key
   */
  static getUriSync(key: string): string {
    return "datashare:///com.ohos.settingsdata/entry/settingsdata/SETTINGSDATA?Proxy=true&key=" + key;
  }
}
/**
 * 定时开关机错误码
 */
//0 成功
export const SET_SUCCESS: number = 0;
//-1 错误
export const ERROR_UNKNOWN: number = -1;
//-2 参数有误
export const ERROR_CONFIG: number = -2;
//-5 异常
export const ERROR_EXCEPTION: number = -5;
//设置时间已过
export const ERROR_TIME_PASSED: number = 100;
//开机时间和关机时间没有相差3分钟
export const ERROR_COMPARE_ON_OFF_TIME: number = 101;
//当前时间和关机时间没有相差3分钟
export const ERROR_COMPARE_NOW_OFF_TIME: number = 102;
//当前时间和开机时间没有相差6分钟，需要先关再开
export const ERROR_COMPARE_NOW_ON_TIME: number = 103;


